﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Greve
{
    public class Person
    {
        public string name;
        public string gender;
        public List<Dive> jumps;
        public double totalScore;
        public int ID;
        public Person()
        {
            totalScore = 0;
			jumps = new List<Dive>();
        }

        public Person (int ID, string name, string gender)
        {
			jumps = new List<Dive>();
            this.ID = ID;
            this.name = name;
            this.gender = gender;
            totalScore = 0;
        }
        public Person (Person p)
        {
			jumps = p.jumps;
            this.ID = p.ID;
            this.name = p.name;
            this.gender = p.gender;
            this.totalScore = p.totalScore;
            this.jumps = p.jumps;
        }
        public void addScore(double calculatedScore)
        {
            totalScore += calculatedScore;
        }

        public void addJump(String ID, string name, double diff)
        {
            jumps.Add(new Dive(ID, diff, name));
        }
        public override string ToString()
        {
            String rtn = name + " "+ gender + " " + totalScore + " " + ID;
            foreach(Dive d in jumps)
            {
                rtn+= " Dive<" + d.difficulty + "<" + d.height + "<" + d.ID + "<" + d.jump + "<" +d.score +"<";

            }
 	        return rtn;
        }
    }
}
